
%Input : "Figure 2-Panel a-MATLAB data.mat" & Figure 2-Panel b-MATLAB data.mat"
%Output : Surface plots in Figure 2-panel a&b - wich displays the
%deformeation of the membrane at Px and Py for small indentations

C1=-Data_Px1000.fin(:,3);  %final z-axis displacement of all elements in the FEA mesh at Px
C2=-Data_Py1000.fin(:,3);  %%final z-axis displacement of all elements in the FEA mesh at Py

x = Data_Px1000.ini(:,1); y = Data_Px1000.ini(:,2); z = Data_Px1000.ini(:,3) ;
% [X,Y] = meshgrid(x,y);
dt = delaunayTriangulation(x,y); 
tri = dt.ConnectivityList; 
xi = dt.Points(:,1) ; yi = dt.Points(:,2) ;
F = scatteredInterpolant(x,y,z);
zi = F(xi,yi);

bottom = min(min(C1),min(C2));
top = max(max(C1),max(C2));

subplot(1,2,1);
trisurf(tri,xi,yi,zi,C1);
shading interp;
colormap parula;
% set(gca,'zlim',[-1000,1000]);
caxis manual
caxis([bottom top]);

subplot(1,2,2);
trisurf(tri,xi,yi,zi,C2);
shading interp;
colormap parula;
caxis manual
caxis([bottom top]);

colorbar;